<?php

namespace app\common\business;

use app\common\model\mysql\SysOperLog as SysOperLogModel;

class SysOperLog
{
    public $operLogObj = null;
    public function __construct()
    {
        $this->operLogObj = new SysOperLogModel();
    }

    //查询操作日志
    public function getNormalOperLog($where,$field,$limit,$page,$order = []){
        $operLogData = $this->operLogObj->getNormalOperLogList($where,$field,$limit,$page,$order);
        if(!$operLogData){
            return [];
        }
        $operLogData = $operLogData->toArray();
        return $operLogData;
    }

    //根据$ids数组，删除数据库记录delete
    public function DelOperLogIds($ids){
        $ids = explode(',', $ids);
        $result = $this->operLogObj->DelOperLogIds($ids);
        return $result;
    }

    //清空操作日志表
    public function operlogCleanBus(){
        $result = $this->operLogObj->operlogCleanModel();
        return $result;
    }
}
